export const option = (that) => {
  return {
    title: '',
    align: 'center',
    menuAlign: 'center',
    index: true,
    indexLabel: that.$t('common.index'),
    border: true,
    delBtn: false,
    editBtn: false,
    addBtn: false,
    menu: false,
    columnBtn: false,
    refreshBtn: false,
    column: [{
      label: that.$t('common.key'),
      prop: 'fieldName',
      slot: true
    }, {
      label: that.$t('common.value'),
      prop: 'fieldVal',
      slot: true
    }, {
      label: that.$t('common.outMessage'),
      prop: 'message',
      slot: true
    }]
  }
}

export const option2 = (that) => {
  return {
    title: '',
    align: 'center',
    menuAlign: 'center',
    index: true,
    indexLabel: that.$t('common.index'),
    border: true,
    delBtn: false,
    editBtn: false,
    addBtn: false,
    menu: false,
    columnBtn: false,
    refreshBtn: false,
    column: [{
      label: that.$t('common.key'),
      prop: 'fieldName',
      slot: true
    }, {
      label: that.$t('common.value'),
      prop: 'fieldVal',
      slot: true
    }]
  }
}

export const formOption = that => {
  return {
    submitBtn: false,
    emptyBtn: false,
    column: [{
      label: that.$t('basicData.orgName'),
      prop: 'orgId',
      type: 'tree',
      dicData: [],
      clearable: false,
      props: {
        label: 'orgName',
        value: 'id'
      },
      span: 5,
      change: that.changeTree
    }, {
      label: that.$t('common.factory'),
      prop: 'factoryId',
      type: 'select',
      dicData: [],
      props: {
        label: 'factoryName',
        value: 'id'
      },
      clearable: false,
      span: 5,
      change: that.changeFactory
    }, {
      label: that.$t('common.product'),
      prop: 'productId',
      span: 5,
      type: 'select',
      dicData: [],
      props: {
        label: 'materialName',
        value: 'materialId'
      },
      change: that.changeProduct
    }]
  }
}

export const formOption2 = that => {
  return {
    submitBtn: false,
    emptyBtn: false,
    column: [{
      label: that.$t('basicData.orgName'),
      prop: 'orgId',
      type: 'tree',
      dicData: [],
      clearable: false,
      props: {
        label: 'orgName',
        value: 'id'
      },
      span: 6,
      change: that.changeTree
    }, {
      label: that.$t('common.busiFuncId'),
      prop: 'busiFuncId',
      type: 'select',
      dicData: [],
      clearable: false,
      props: {
        label: 'funcName',
        value: 'id'
      },
      span: 6,
      change: that.changeBusi
    }, {
      label: that.$t('empTypeTree.classify'),
      prop: 'classId',
      type: 'select',
      dicData: [],
      props: {
        label: 'className',
        value: 'id'
      },
      span: 6,
      change: that.changeClass
    }]
  }
}

export const resultOption = that => {
  return {
    title: '',
    align: 'center',
    menuAlign: 'center',
    index: true,
    indexLabel: that.$t('common.index'),
    border: true,
    delBtn: false,
    editBtn: false,
    addBtn: false,
    menu: false,
    columnBtn: false,
    refreshBtn: false,
    selection: true,
    column: [{
        label: that.$t('common.productNumber'),
        prop: 'materialNo'
      }, {
        label: that.$t('common.productName'),
        prop: 'materialName'
      },
      // {
      //   label: '需求数量',
      //   prop: ''
      // }, 
      {
        label: that.$t('basicData.unitName'),
        prop: 'unitName'
      },
      // {
      //   label: '单价',
      //   prop: ''
      // }, {
      //   label: '总价',
      //   prop: ''
      // }, 
      {
        label: that.$t('common.viewBom'),
        prop: 'viewBom',
        slot: true
      }, {
        label: that.$t('commno.matchingDegree'),
        prop: 'matchingDegree',
        slot: true
      }
    ]
  }
}
